package com.Tradition.service;

import org.springframework.stereotype.Service;




import com.Tradition.mapper.UserMapper;
import com.Tradition.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class UserRegService {
    @Autowired
    private UserMapper userMapper;
    public int reg(String username,String password){
        int insert = userMapper.insert(new User(null,username,password,new Date(),null,0));
        return insert;
    }
    public int checkUserName(String username){
        List<User> User = userMapper.selectByUserName(username);
        return User.size()>0?1:0;
    }
}
